package com.simon.train.member.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PassengerSaveDto {
    private Long id;

    /**
     * Long类型不可以用NotBlank来进行校验
     * NotBlank只能用于设置String类型
     *
     * 因为后续会员id通过上下文线程获取了 也就不需要检验了
     */
//    @NotNull(message = "【会员ID】不能为空")
    private Long memberId;

    @NotBlank(message = "【姓名】不能为空")
    private String name;

    @NotBlank(message = "【身份证号】不能为空")
    private String idCard;

    @NotBlank(message = "【旅客种类】不能为空")
    private String type;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

}